package com.bq.server.base;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.SuperBuilder;

import java.time.LocalDateTime;

/**
 * 更新实体
 * @author: ChenSH
 * @date: Create by in 08:38 2019-09-18
 */
@Data
@SuperBuilder
@EqualsAndHashCode(callSuper = true)
public abstract class UpdatedEntity<T extends UpdatedEntity<T>> extends CreatedEntity<T> {


    /**
     * 最后更新人
     */
    @TableField(fill = FieldFill.UPDATE)
    private String updatedBy;

    /**
     * 最后更新时间
     */
    @TableField(fill = FieldFill.UPDATE)
    private LocalDateTime updatedDate;

    public UpdatedEntity() {
    }

    public UpdatedEntity(Long id, String createdBy, LocalDateTime createdDate, String updatedBy, LocalDateTime updatedDate) {
        super(id, createdBy, createdDate);
        this.updatedBy = updatedBy;
        this.updatedDate = updatedDate;
    }
}
